package com.gxuwz.business.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.gxuwz.business.dao.impl.TreatDAO;
import com.gxuwz.business.entity.Treat;
import com.gxuwz.business.service.ITreatService;
import com.gxuwz.util.Pager;

@Service("treatService")
public class TreatServiceImpl implements ITreatService {

	@Autowired
	private TreatDAO treatDAO;
	
	@Override
	public boolean add(Treat treat) {
		return treatDAO.add(treat);
		
	}

	@Override
	public void update(Treat treat) {
		treatDAO.update(treat);
	}

	@Override
	public void delete(Treat treat) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public Treat findById(Treat treat) {
		return treatDAO.findById(treat);
	}

	@Override
	public List<Treat> getRightAll() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Pager<Treat> getByPager(Treat treat, Integer page, Integer limit) {
		return treatDAO.getByPager(treat, page, limit);
	}
	
	public void updateCountState(Treat treat){
		treatDAO.updateCountState(treat);
	}

	@Override
	public List<String> getAllIdIsRecipe() {
		return treatDAO.getAllIdIsRecipe();
	}

	@Override
	public Pager<Treat> getByPagerRec(Integer page, Integer limit) {
		return treatDAO.getByPagerRec(page, limit);
	}

}
